package com.wxy.netty.byteBuf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;

/**
 * @author 47868
 */
public class CreateByteBuf {
    public static void main(String[] args) {
        //可以自动扩容
        //默认获取直接内存
        //netty4.1之后默认对byteBuf池化
        ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer();
        //显式获取堆内存
        ByteBuf byteBuf1 = ByteBufAllocator.DEFAULT.heapBuffer();
        //显式获取直接内存
        ByteBuf byteBuf2 = ByteBufAllocator.DEFAULT.directBuffer();

    }
}
